<?

if ($c = stack('name')) {

	$_id_component	= $DATA['components'][$c]['id'];			//	list id value
	$_id_data		= D_MB_DATA;			//	meta id value
	$_id_meta		= D_MB_META;			//	meta id value
	
	$_crit = "id_data=$_id_data AND id_parent=$_id_component AND ".dbAndL('attr', AA_VISIBLE);

	$s = array_extend( array(
		'path' => 'catalog', 'w' => 128, 'h' => 96, 'param' => 'id', 'caption' => '', 'lw' => 400, 'lh' => 300,
		'gal_path' => 'catalog/gal', 'gal_tn' => FP_TN_DIR, 'gal_w' => 800, 'gal_h' => 600, 'gal_tnw' => 96, 'gal_tnh' => 96
	), $DATA['components'][$c]['settings']);


	
	$DATA['components'][$c]['data'] = array_mark_bounds( datafetch_array('db_list', array('table' => tb('data'), 'where' => "$_crit",	'order' => 'id_index', 'index' => 'id' )));

	foreach($DATA['components'][$c]['data'] as $k => $v) {
		$DATA['components'][$c]['data'][$k] = array_merge($v, datafetch_array('loadmeta', $_id_meta, 
			array('parent' => $k, 'assoc' => context('lang'), 'getclob' => 1)));
		$DATA['components'][$c]['data'][$k]['image'] = checkImage(FP_UPLOAD_PATH.$s['path'], $k);
	}

	unstack();
}